package cn.edu.nwsuaf.studentcenter.pojo;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * CourceEmployeeId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class CourceEmployeeId implements java.io.Serializable {

	// Fields

	private String courceNo;
	private String classNo;
	private String teacherNo;

	// Constructors

	/** default constructor */
	public CourceEmployeeId() {
	}

	/** full constructor */
	public CourceEmployeeId(String courceNo, String classNo, String teacherNo) {
		this.courceNo = courceNo;
		this.classNo = classNo;
		this.teacherNo = teacherNo;
	}

	// Property accessors

	@Column(name = "cource_no", nullable = false, length = 50)
	public String getCourceNo() {
		return this.courceNo;
	}

	public void setCourceNo(String courceNo) {
		this.courceNo = courceNo;
	}

	@Column(name = "class_no", nullable = false, length = 50)
	public String getClassNo() {
		return this.classNo;
	}

	public void setClassNo(String classNo) {
		this.classNo = classNo;
	}

	@Column(name = "teacher_no", nullable = false, length = 50)
	public String getTeacherNo() {
		return this.teacherNo;
	}

	public void setTeacherNo(String teacherNo) {
		this.teacherNo = teacherNo;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof CourceEmployeeId))
			return false;
		CourceEmployeeId castOther = (CourceEmployeeId) other;

		return ((this.getCourceNo() == castOther.getCourceNo()) || (this
				.getCourceNo() != null && castOther.getCourceNo() != null && this
				.getCourceNo().equals(castOther.getCourceNo())))
				&& ((this.getClassNo() == castOther.getClassNo()) || (this
						.getClassNo() != null && castOther.getClassNo() != null && this
						.getClassNo().equals(castOther.getClassNo())))
				&& ((this.getTeacherNo() == castOther.getTeacherNo()) || (this
						.getTeacherNo() != null
						&& castOther.getTeacherNo() != null && this
						.getTeacherNo().equals(castOther.getTeacherNo())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getCourceNo() == null ? 0 : this.getCourceNo().hashCode());
		result = 37 * result
				+ (getClassNo() == null ? 0 : this.getClassNo().hashCode());
		result = 37 * result
				+ (getTeacherNo() == null ? 0 : this.getTeacherNo().hashCode());
		return result;
	}

}